<template>
  <div class="home">
    <el-container style="height: 500px; border: 1px solid #eee">
      <el-aside
        width="200px"
        style="background-color: rgb(238, 241, 246); height: 200%"
      >
        <div class="left_nav">
          <el-menu
            class="el-menu-vertical-demo"
            background-color="#545c64"
            active-text-color="#ffd04b"
            text-color="#fff"
            router
            :default-active="$route.path"
          >
            <el-submenu index="1">
              <template slot="title"
                ><i class="el-icon-message"></i>导航一</template
              >
              <el-menu-item index="/home/message">
                <i class="el-icon-phone-outline"></i> <span>留言列表</span>
              </el-menu-item>
              <el-menu-item index="/home/add">
                <i class="el-icon-message"></i> <span>留言添加</span>
              </el-menu-item>
            </el-submenu>

            <el-submenu index="2">
              <template slot="title"
                ><i class="el-icon-menu"></i>导航二
              </template>
              <el-menu-item index="/home/user">
                <i class="el-icon-message"></i> <span>成员列表</span>
              </el-menu-item>
            </el-submenu>

            <el-submenu index="3">
              <template slot="title"
                ><i class="el-icon-setting"></i>导航三
              </template>
            </el-submenu>
          </el-menu>
        </div>
      </el-aside>
      <el-main>
        <router-view> </router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    const item = {
      date: "2016-05-02",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1518 弄",
    };
    return {
      tableData: Array(20).fill(item),
    };
  },
  components: {},
};
</script>
<style lang="scss" scoped>
.home {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  .left_nav {
    width: 100%;
    height: 100vh;
    background-color: #545c64;
  }
  .right {
    width: calc(100% - 300px);
    background-color: aquamarine;
  }
}
</style>
